<?php
define('DS', DIRECTORY_SEPARATOR);
define('LIB',  dirname(__FILE__));

define('BASE', dirname(dirname(__FILE__)));
define('CONFIG', BASE . '/config');
define('HTDOCS', BASE . '/htdocs');
define('TASK', BASE . '/tasks');
define('TEMP_', BASE . '/temp');
define('TEMP_BIN', BASE . '/temp/bin');
define('SUBMIT', BASE . '/submissions');
define('GRADER_LOG', BASE . '/scripts/grader.log');
define('EVALUATOR', BASE . '/scripts/php');

define('VIEW', LIB . '/views');
define('MODULE', LIB . '/modules');
define('SKILLS_D', LIB . '/modules/skills');
define('SKILL_D', SKILLS_D);
define('MODEL', LIB . '/models');
define('FRAMEWORK', LIB . '/framework');

require CONFIG . '/config.php';

require FRAMEWORK . '/master.inc.php';
require LIB . '/loader.php';

// My DBObject
require LIB . '/a.dbobject.php';

// My Auth util function

function requireUser() {
	$a = Auth::getAuth();
	$a->requireUser(WEB_ROOT . '/user/login');
}

function requireAdmin() {
	$a = Auth::getAuth();
	$a->requireLevel(9, WEB_ROOT . '/');
}

// date timezone
date_default_timezone_set('Asia/Bangkok');
$requestTime = gmdate('U');

